From: Giovanni Campagna Date: Sat, 22 Dec 2012 15:02:19 +0000 (+0100) Subject: MessageTray: fix reentrancy problem in hideNotificationCompleted X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~5013 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=85743ede7e66512ea4cf447994de9292b965d7bf;p=gnome-shell.git MessageTray: fix reentrancy problem in hideNotificationCompleted Hiding notificationWidget with a telepathy notification causes unfocused to be emitted, which causes a reentrant updateState. If another notification is queued, it is shown before the old one is cleared. https://bugzilla.gnome.org/show_bug.cgi?id=683986 --- diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index 44d884fe5..861f32588 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -2270,7 +2270,7 @@ const MessageTray = new Lang.Class({ this._notificationClickedId = this._notification.connect('done-displaying', Lang.bind(this, this._escapeTray)); - this._notification.connect('unfocused', Lang.bind(this, function() { + this._notificationUnfocusedId = this._notification.connect('unfocused', Lang.bind(this, function() { this._updateState(); })); this._notificationBin.child = this._notification.actor; @@ -2410,19 +2410,22 @@ const MessageTray = new Lang.Class({ }, _hideNotificationCompleted: function() { - this._notificationRemoved = false; - this._notificationWidget.hide(); - this._closeButton.hide(); - this._pointerInTray = false; - this.actor.hover = false; // Clutter doesn't emit notify::hover when actors move - this._notificationBin.child = null; this._notification.collapseCompleted(); this._notification.disconnect(this._notificationClickedId); this._notificationClickedId = 0; + this._notification.disconnect(this._notificationUnfocusedId); + this._notificationUnfocusedId = 0; let notification = this._notification; this._notification = null; if (notification.isTransient) notification.destroy(NotificationDestroyedReason.EXPIRED); + + this._notificationRemoved = false; + this._closeButton.hide(); + this._pointerInTray = false; + this.actor.hover = false; // Clutter doesn't emit notify::hover when actors move + this._notificationBin.child = null; + this._notificationWidget.hide(); }, _expandActiveNotification: function() {